-
Notifications
You must be signed in to change notification settings - Fork 8k
zend_compile: Bundle function type constants into an zend_function_type enum
#21208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ype` enum This clarifies the relationship between these constants and improves type safety a little.
iluuu1994
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable, thanks!
|
|
||
| #define ZEND_CLASS_CONST_FLAGS(c) Z_CONSTANT_FLAGS((c)->value) | ||
|
|
||
| #if __STDC_VERSION__ >= 202311L |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this also works for C++11. Not important to me, but maybe other folks.
| ZEND_USER_FUNCTION = 2, | ||
| ZEND_EVAL_CODE = 4, | ||
| }; | ||
| typedef enum _zend_function_type zend_function_type; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Names starting with underscore are reserved to the implementation .We've previously done effort to get rid of underscores in places and generally don't add new ones.
| }; | ||
| typedef enum _zend_function_type zend_function_type; | ||
| #else | ||
| enum _zend_function_type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit unfortunate that this is a duplicated definition. Changing one code smell with another.
This clarifies the relationship between these constants and improves type safety a little.